pragmas

Are these all the pragmas? What do they do?

Must start a line; must have EOL at end.
Samples:
pragma encoding,"UTF-8"
pragma runLim, 0

encoding    string
splashMessage   string
stack           int     4096 s default
permfn          int
perm            int
runLim          int     1000000 is default
??print         ??
date            ??


'print' a pragma?

 

 

  • Louie

 

 


llandale - Thu Apr 29 11:24:23 EDT 2010

Re: pragmas
Mathias Mamsch - Sat May 01 16:14:53 EDT 2010

Hey Louie,

the perm/permfn pragmas register the syntax of a built-in perm to the DXL Parser.

Example:

string ::+(int,int) pragma perm, 10

 


Tells the XTC Virtual machine, that whenever a DXL calls the + operator then it will execute function number 10 from the internal function table.

This is pretty useless to any user program, unless they modify the internal function table(s). However you could load a custom DLL into memory, and do a manipulation of the function tables to really add new builtin perms to the DOORS client. Or you could change the behavior of a builtin perm to a customized version.

The difference between perm and permfn is (i think) that "perm" refers to the XTC virtual machine while permfn refers to a DXL built in perm. But I am not quite sure about that.

Note that executing this pragma makes only sense in the dxl top level context, that is using evalTop_.

Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: pragmas
Mathias Mamsch - Sat May 08 18:28:05 EDT 2010

And another pragma demystified:

pragma encoding accepts only one valid string argument "UTF-8". This will tell the parser from the place of the instruction to read the rest of the file using the UTF encoding, so put it at the start of your DXL file, if you have any special characters in there. Notice that the DOS commandline does not support UTF output, so trying to print stuff in batch mode will still give invalid results.
 

pragma encoding, "UTF-8"

 


Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: pragmas
llandale - Mon May 10 12:00:41 EDT 2010

Mathias Mamsch - Sat May 08 18:28:05 EDT 2010

And another pragma demystified:

pragma encoding accepts only one valid string argument "UTF-8". This will tell the parser from the place of the instruction to read the rest of the file using the UTF encoding, so put it at the start of your DXL file, if you have any special characters in there. Notice that the DOS commandline does not support UTF output, so trying to print stuff in batch mode will still give invalid results.
 

pragma encoding, "UTF-8"

 


Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

What special charaters; >255 ascii? Is there any reason NOT to use this pragma in all your DXL? Would perhaps >pragma encoding,""< reset the encoding?

Re: pragmas
Mathias Mamsch - Tue May 11 13:09:25 EDT 2010

llandale - Mon May 10 12:00:41 EDT 2010
What special charaters; >255 ascii? Is there any reason NOT to use this pragma in all your DXL? Would perhaps >pragma encoding,""< reset the encoding?

See Wikipedia for information on UTF-8. For most DXL putting the pragma in the DXL file will not have any influence, since only characters between ASCII 0 and ASCII 127 are used. Characters with an ascii code 128+ have a special meaning in UTF-8 and will be decoded differently with the pragma. This means, if your editor stored your file in ANSI (also called Windows Latin-1 or Windows-1252) you might experience problems with special characters. And yes UTF-8 can display all kinds of characters. Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS